package com.lin.utils;

import java.util.Random;

/**
 * Created by MYQ on 2017/8/31.
 */
public class KeyUtils {
    /**
     * 生成唯一主键
     * 格式：时间+随机数
     *
     */
    public static synchronized String getUniqueKey(){
        Random random=new Random();
        Integer a=random.nextInt(900000)+100000;
        return System.currentTimeMillis()+String.valueOf(a);
    }
}
